<%@ Page Language="C#"%>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="JSClass" %>
<%
    String start = Request["start"];
    String end = Request["end"];
	String ghbbcode = Request["ghbbcode"];
	
	if (start == null) start = "1";
    if (start.Equals("")) start = "1";
	if (end == null) start = "10";
    if (end.Equals("")) start = "10";
	
	if (ghbbcode == null) ghbbcode = "";
	
	StringBuilder sb = new StringBuilder();
    sb.Append("SELECT * \n");
    sb.Append("FROM \n");
    sb.Append("( \n");
    sb.Append("SELECT ROWNUM RNUM , PNU , JUSO , JIBEON , X_POS , Y_POS FROM EXGIS2011_JIBEON_YD WHERE 1 = 1  \n");
	if (!ghbbcode.Equals(""))
	{
		sb.Append("and GHBBBSCODE='" + ghbbcode + "'  \n");
    }
	sb.Append("and IS_NAVER is null \n");
    sb.Append(") \n");
    sb.Append("WHERE RNUM >= " + start + " AND RNUM <= " + end + " \n");
	
	TableQuery myQuery = new TableQuery(sb.ToString());
    Response.Write(myQuery.GetJSON());
    %>